Trying to send XML via EMail and the XML includes a byte[]

Posted by barbary on Stack Overflow See other posts from Stack Overflow or by barbary
Published on 2010-05-21T18:17:02Z Indexed on 2010/05/21 18:20 UTC
Read the original article Hit count: 132

Filed under:
|
|

Hello All,

I want to send an email that has a machine readable part you cut and paste into an asp.net page and you get the information.

I have stored all the information in an object and then used an XMLSerizer to create some xml. It all worked fine until I added some Images as byte[] to the object.

If I dump the resulting string to disk then I can recreate the object fine but after it appears in the email client and I try to cut and paste it it never works.

Clearly there are non standard characters coming out that email clients don't like.

Is there some encoding I could apply to my XML that would make it display correctly in an email client? Then I could cut, paste, decode and deserilize to get my object back.

Please an example of how to encode the string in c# would be great.

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET